﻿<%@ Page Title="Quản lý Bài viết" Language="C#" MasterPageFile="~/Manager.Master" AutoEventWireup="true" CodeBehind="NewsManager.aspx.cs" Inherits="Manager.NewsManager" %>
<%@ Register Src="~/Controls/ucPaging.ascx" TagName="Paging" TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="contentPage" runat="server">
    <div class="breadcrumb">
 <a href="Default.aspx">Trang quản trị</a> >> <a href="NewsManager.aspx">Quản lý Bài viết</a>
</div>

    <div class="box" style="float:left; width: 100%">
        <div class="heading">
            <h1><img src="Styles/Img/order.png" alt="" />Quản lý Bài viết</h1>
            <div class="buttons">
                &nbsp;&nbsp;<asp:Button 
                ID="btnNew" runat="server" Text="Viết bài mới" BackColor="#003A88" 
                CssClass="button" onclick="btnNew_Click" />
            </div>
        </div>

        <div class="content">
            <asp:Panel ID="pnlSearch" DefaultButton="btnSearch" runat="server">
                            <asp:Label ID="lblSearch" runat="server" Text="Từ khóa: &nbsp;&nbsp;" 
                                Font-Names="Verdana" Font-Size="16px" ForeColor="#006699"></asp:Label>
                           <asp:TextBox ID="txtSearch" runat="server" style="width: 300px"></asp:TextBox> &nbsp; &nbsp;
                           <asp:Button ID="btnSearch" runat="server" Text="Tìm" CssClass="button" 
                                onclick="btnSearch_Click" /><br />
                           <div class="clear"></div>
            </asp:Panel>
                           <br />
            
            <table class="list">
                <thead>
                    <tr>
                        <td style="width: 4%; text-align:center">STT</td>
                        <td style="width: 35%" class="center">Tiều đề</td>
                        <td style="width: 45%" class="center">Miêu tả sơ lược</td>
                        <td style="width: 8%" class="center">Trạng thái</td>
                        <td style="width: 8%" class="center">Chức năng</td>
                    </tr>
                </thead>
                <tbody>
                    <tr class="filter">
                        <td colspan="6">&nbsp;</td>
                    </tr>
                    <tr id="noNews" runat="server" visible="false">
                        <td colspan="6">&nbsp;&nbsp;&nbsp;&nbsp;<span style="font: 20px; color: Red;">Chưa bản tin nào.</span></td>
                    </tr>
                
                            <asp:Repeater ID="rptNews" runat="server" 
                        onitemdatabound="rptNews_ItemDataBound" 
                        onitemcommand="rptNews_ItemCommand">
                                <ItemTemplate>
                                            <tr>
                                                <td style="width: 4%; text-align:center"><%#Eval("RowNumber")%></td>
                                                <td style="width: 35%" class="center"><a href="ViewNews.aspx?NewsID=<%#Eval("NewsID") %>"><%#Eval("NewsTitle")%></a></td>
                                                <td style="width: 45%" class="center"><asp:Label ID="lblDescription" runat="server"></asp:Label></td>
                                                <td style="width: 8%" class="center"><asp:Label ID="lblStatus" runat="server"></asp:Label></td>
                                                <td style="width: 8%" class="center">
                                                    <asp:LinkButton ID="lbtView" CommandArgument='<%#Eval("NewsID") %>' CommandName="View" runat="server"><img src="Styles/Img/edit.png" alt="Xem và Sửa đổi" title="Xem và Sửa đổi" /></asp:LinkButton>&nbsp;&nbsp;
                                                    <asp:LinkButton ID="lbtLock" CommandArgument='<%#Eval("NewsID") %>' CommandName="Lock" runat="server">
                                                        <asp:Image ID="imgLock" ToolTip="Khóa" ImageUrl="~/Styles/Img/unlock.png" runat="server" /></asp:LinkButton>&nbsp;&nbsp;
                                                    <asp:LinkButton ID="lbtDel" CommandArgument='<%#Eval("NewsID") %>' CommandName="Del" OnClientClick='return confirm("Bạn có chắc chắn muốn xóa???")' runat="server"><img src="Styles/Img/delete.png" alt="Xóa" title="Xóa" /></asp:LinkButton>&nbsp;&nbsp;
                                                </td>
                                            </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                    <tr class="filter">
                        <td colspan="6">&nbsp;</td>
                    </tr>
                <tr>
                    <td colspan="6">
                    <uc:Paging ID="ucPaging" runat="server" />
                    </td>
                </tr>
                </tbody>
            </table>

            
        </div>
    </div>
</asp:Content>
